ret = 0;
op->u.createdomain.domain = d->domain_id;
- copy_to_user(u_dom0_op, op, sizeof(*op));
+ if ( copy_to_user(u_dom0_op, op, sizeof(*op)) )
+ ret = -EFAULT;
}
break;
case DOM0_SCHEDCTL:
{
ret = sched_ctl(&op->u.schedctl);
- copy_to_user(u_dom0_op, op, sizeof(*op));
+ if ( copy_to_user(u_dom0_op, op, sizeof(*op)) )
+ ret = -EFAULT;
}
break;
case DOM0_ADJUSTDOM:
{
ret = sched_adjdom(&op->u.adjustdom);
- copy_to_user(u_dom0_op, op, sizeof(*op));
+ if ( copy_to_user(u_dom0_op, op, sizeof(*op)) )
+ ret = -EFAULT;
}
break;
getdomaininfo(d, &op->u.getdomaininfo);
if ( copy_to_user(u_dom0_op, op, sizeof(*op)) )
- ret = -EINVAL;
+ ret = -EFAULT;
put_domain(d);
}
if ( copy_to_user(buffer, &info, sizeof(dom0_getdomaininfo_t)) )
{
- ret = -EINVAL;
+ ret = -EFAULT;
break;
}
op->u.getdomaininfolist.num_domains = num_domains;
if ( copy_to_user(u_dom0_op, op, sizeof(*op)) )
- ret = -EINVAL;
+ ret = -EFAULT;
}
break;
case DOM0_TBUFCONTROL:
{
ret = tb_control(&op->u.tbufcontrol);
- copy_to_user(u_dom0_op, op, sizeof(*op));
+ if ( copy_to_user(u_dom0_op, op, sizeof(*op)) )
+ ret = -EFAULT;
}
break;
&op->u.readconsole.buffer,
&op->u.readconsole.count,
op->u.readconsole.clear);
- copy_to_user(u_dom0_op, op, sizeof(*op));
+ if ( copy_to_user(u_dom0_op, op, sizeof(*op)) )
+ ret = -EFAULT;
}
break;
case DOM0_SCHED_ID:
{
op->u.sched_id.sched_id = sched_id();
- copy_to_user(u_dom0_op, op, sizeof(*op));
- ret = 0;
+ if ( copy_to_user(u_dom0_op, op, sizeof(*op)) )
+ ret = -EFAULT;
+ else
+ ret = 0;
}
break;
{
extern int perfc_control(dom0_perfccontrol_t *);
ret = perfc_control(&op->u.perfccontrol);
- copy_to_user(u_dom0_op, op, sizeof(*op));
+ if ( copy_to_user(u_dom0_op, op, sizeof(*op)) )
+ ret = -EFAULT;
}
break;
#endif